package com.example.smart_community.controller;

import com.example.smart_community.model.MessageModel;
import com.example.smart_community.po.Repairorder;
import com.example.smart_community.service.RepairorderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
@CrossOrigin
@RestController
@RequestMapping("/repairorder")
public class RepairorderController {
    @Autowired
    private RepairorderService repairorderService;
    @GetMapping("/selectByStatus")
    public List<Repairorder> selectByStatus(Integer statusId){
        return repairorderService.selectByStatus(statusId);
    }
    @GetMapping("/updateStatus")
    public MessageModel updateStatus(Integer id, Integer staffId, String assigntime, Integer statusId, String completetime){
        return repairorderService.updateStatus(id, staffId, assigntime, statusId, completetime);
    }
    @GetMapping("/selectByStaffId")
    public  List<Repairorder> selectByStaffId(Integer staffId){
        return repairorderService.selectByStaffId(staffId);
    }
}
